﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace NewAI.FSM.SocketConnectFSM
{
    public class TimeDelayState : State<AIClientSocket>
    {
        private int delayTime;

        public TimeDelayState(int delayTime)
        {
            this.delayTime = delayTime;
        }

        public override void Enter(AIClientSocket entity)
        {
            if (delayTime > 0)
                Thread.Sleep(delayTime);
            entity.ChangeState(new ConnectToGameServerState());
        }
    }
}
